package cn.smvc.task.service;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import cn.smvc.task.entity.TTimedTask;

@Service
public interface TTimedTaskService {
	
	public List<TTimedTask> findAll() throws SQLException;
	
	public List<TTimedTask> findAllTaskGroup() throws SQLException;
	
	public TTimedTask findOne(String id) throws SQLException;
	
	public int save(TTimedTask task) throws SQLException;
	
	public int delete(String id) throws SQLException;
	
	public int update(TTimedTask task) throws SQLException;
	
	public int updateRunFlag(String id, String runFlag) throws SQLException;
	
	public int updateNextExecuteDatetime(String nextExecuteTimestamp, String nextExecuteDatetime, String id) 
			throws SQLException;
	
	public int updateNextAndLastExecuteDatetime(
			String nextExecuteTimestamp, String nextExecuteDatetime, 
			String lastExecuteTimestamp, String lastExecuteDatetime,String id) 
			throws SQLException;
	public int updateAllRunFlag(String runFlag);
	
	/**
	 * 分页查询
	 * @param param
	 * @return
	 */
	public Map<String, Object> queryPage(Map<String, String[]> param);
}
